﻿<UserControl x:Class="TimeSplicerModule.Views.TeamView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             Width="500" Height="500">
    <UserControl.Resources>
        <Style TargetType="Border">
            <Setter Property="Margin" Value="5" />
        </Style>
    </UserControl.Resources>


    <Grid VerticalAlignment="Top" HorizontalAlignment="Left">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition Height="75" />
        </Grid.RowDefinitions>


        <Border Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right">
            <TextBlock Text="Team:" />
        </Border>

        <Border Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left">
            <TextBox Text="{Binding Name, Mode=TwoWay}" Width="150" Height="25" />
        </Border>

        <Border Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right">
            <TextBlock Text="Parent Team:" />
        </Border>

        <Border Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left">
            <ComboBox Name="teamsComboBox" ItemsSource="{Binding Path=Teams}" Width="150" Height="25" 
                      DisplayMemberPath="Name"
                      SelectedValuePath="TeamGuid"
                      SelectedValue="{Binding Path=ParentTeamGuid, UpdateSourceTrigger=PropertyChanged}">
            </ComboBox>
        </Border>
        
        <!-- Description -->
        <Border Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right">
            <TextBlock Text="Description:" />
        </Border>
        
        <Border Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left">
            <TextBox Text="{Binding Description, Mode=TwoWay}"  Width="150" />
        </Border>
        
        <!-- Dimension Y -->
        <Border Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right">
            <TextBlock Text="Dimension Y:" />
        </Border>

        <Border Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left">
            <TextBox Text="{Binding Y, Mode=OneWay}" Width="50" Height="25" IsReadOnly="True" />
        </Border>

        <!-- Dimension X -->
        <Border Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Right">
            <TextBlock Text="Dimension X:" />
        </Border>

        <Border Grid.Column="1" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left">
            <TextBox Text="{Binding X, Mode=OneWay}" Width="50" Height="25" IsReadOnly="True" />
        </Border>


        <Border Grid.Column="0" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Right">
            <TextBlock Text="Is Active:" />
        </Border>

        <Border Grid.Column="1" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Left">
            <CheckBox IsChecked="{Binding IsActive, Mode=TwoWay}" />
        </Border>

        <Border Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center">
            <StackPanel Orientation="Horizontal">
                <Button Name="saveButton" Content="Save" Width="100" Height="25" Click="saveButton_Click" />
                <Button Name="saveExitButton" Content="Save &amp; Exit" Width="100" Height="25" Click="saveExitButton_Click" Margin="15,0,0,0" />
                <Button Name="cancelButton" Content="Cancel" Width="100" Height="25" Click="cancelButton_Click" Margin="15,0,0,0" />
            </StackPanel>
        </Border>
    </Grid>
</UserControl>
